package com.framework.main.sys.module.action; 

import java.util.List;

import com.framework.main.sys.module.service.ModuleService;
import com.framework.base.struts.BaseAction;
import com.framework.base.struts.BaseVo;
import com.framework.base.util.Struts2Utils;

/**
 * @Description:功能描述：权限管理
 * @Company: www.51wuxia.com
 * @author：www.51wuxia.com
 * @version 1.0
 */
@SuppressWarnings("serial")
public class ModuleAction extends BaseAction {
	private String output;
	private List<BaseVo> moduleList;
	
	public String toViewWholeModuleOper() throws Exception {
		output = ((ModuleService)this.getBaseService()).toViewWholeModuleOper(new StringBuilder(1000), "-2","");
		List list=((ModuleService)this.getBaseService()).toGetNopageList();
		Struts2Utils.getRequest().setAttribute("list", list);
		return SUCCESS;
	}
	
	public String toInsert() throws Exception {
		moduleList = ((ModuleService)this.getBaseService()).toListNoPage();
		output = ((ModuleService)this.getBaseService()).toGetWholeModuleForSelect(new StringBuilder(1000), "-2");
		Struts2Utils.getRequest().setAttribute("output", output);
		return super.toInsert();
	}
	public String toUpdate() throws Exception {
		moduleList = ((ModuleService)this.getBaseService()).toListNoPage();
		output = ((ModuleService)this.getBaseService()).toGetWholeModuleForSelect(new StringBuilder(1000), "-2");
		Struts2Utils.getRequest().setAttribute("output", output);
		return super.toUpdate();
	}
	/**
	 * 用于删除指定的数据
	 * 
	 * @return
	 * @throws Exception
	 */
	public String doDelete() throws Exception {
		String[] pks=Struts2Utils.getRequest().getParameterValues("moduAndOper");
		String resultName = this.getBaseService().doDelete(pks);
		return resultName;
	}
	public List<BaseVo> getModuleList() {
		return moduleList;
	}

	public void setModuleList(List<BaseVo> moduleList) {
		this.moduleList = moduleList;
	}

	public String getOutput() {
		return output;
	}
	public void setOutput(String output) {
		this.output = output;
	}
}
